@import url('https://fonts.googleapis.com/css2?family=Google+Sans+Code:ital,wght@0,300..800;1,300..800&display=swap');

:root {
  --gray-0: #fbfbfb;
  --gray-1: #eee;
  --gray-2: #e4e4e7;
  --gray-3: #d4d4d8;
  --gray-4: #c8c8cf;
  --gray-5: #a1a1a8;
  --gray-6: #4e4e55;
  --gray-7: #323239;
  --gray-8: #25252b;
  --gray-9: #1c1c20;
  --gray-10: #1d1d22;
  --gray-11: #16161a;
  --gray-12: #0d0d11;

  --beige-0: #fdf9ee;
  --beige-1: #f6f0df;
  --beige-2: #eee8d5;
  --beige-25: #e5dcbd;
  --beige-3: #ded4b2;
  --beige-4: #c6ba93;

  --yellow: light-dark(#ffce64, #ffd479);
  --theme-yellow: light-dark(#a07926, #ffd479);
  --theme-green: light-dark(#2d922d, #78d578);
  --theme-pink: light-dark(#d33682, #fb81ba);
  --theme-lavender: light-dark(#8762ec, #a080f9);
  --theme-blue: light-dark(#2f71b4, #72a8ff);

  /* Colors */
  --color-primary: var(--theme-pink);
  --color-highlighted: var(--yellow);
  --color-background: light-dark(var(--beige-0), var(--gray-9));
  --color-background-alternate: light-dark(var(--beige-1), var(--gray-11));
  --color-background-navbar: light-dark(var(--beige-0), var(--gray-9));
  --color-background-navbar-title: light-dark(
    rgba(238, 232, 213, 0.5),
    rgba(15, 15, 15, 0.5)
  );
  --color-background-sidebar: light-dark(var(--beige-0), var(--gray-9));
  --color-background-input: light-dark(var(--beige-1), var(--gray-11));
  --color-background-input-hover: light-dark(var(--beige-2), var(--gray-12));
  --color-background-code: light-dark(var(--beige-2), var(--gray-10));
  --color-background-blockquote: light-dark(var(--beige-1), var(--gray-11));
  --color-background-navbar-link-hover: light-dark(
    var(--beige-2),
    var(--gray-8)
  );
  --color-background-navbar-link-active: light-dark(
    var(--beige-2),
    var(--gray-7)
  );
  --color-background-card: light-dark(var(--beige-1), var(--gray-8));

  --color-text: light-dark(var(--gray-7), var(--gray-4));
  --color-text-emphasized: light-dark(var(--gray-10), var(--gray-0));
  --color-text-muted: light-dark(var(--gray-6), var(--gray-5));
  --color-text-navbar-link: light-dark(var(--gray-7), var(--gray-1));
  --color-text-navbar-link-hover: light-dark(var(--gray-10), var(--gray-0));

  --color-text-link: var(--color-primary);
  --color-text-link-hover: var(--color-primary);

  --color-border: light-dark(var(--beige-25), var(--gray-7));
  --color-border-hover: light-dark(var(--beige-4), var(--gray-5));
  --color-border-blockquote: var(--color-primary);
  --color-border-card: light-dark(var(--beige-3), var(--gray-7));
  --color-marker: light-dark(var(--gray-7), var(--gray-6));

  --color-background-button: light-dark(var(--color-primary), var(--gray-8));
  --color-background-button-hover: light-dark(
    transparent,
    rgba(255, 255, 255, 0.05)
  );
  --color-border-button: light-dark(var(--color-primary), var(--gray-7));
  --color-border-button-hover: var(--color-primary);
  --color-text-button: light-dark(white, var(--gray-0));
  --color-text-button-hover: light-dark(
    var(--color-primary),
    var(--color-primary)
  );
  --color-text-button-emphasized: light-dark(
    var(--gray-11),
    var(--color-primary)
  );

  --font-family: -apple-system, BlinkMacSystemFont, Avenir, Helvetica, Arial,
    sans-serif;
  --font-family-heading: -apple-system, BlinkMacSystemFont, 'DM Sans', Avenir,
    Helvetica, Arial, sans-serif;
  --font-family-monospace: Menlo, 'Google Sans Code', monospace;

  --border-radius: 6px;
  --box-shadow-card-dark: 0px 4px 7px rgba(0, 1, 2, 0.3),
    0px 2px 2px rgba(0, 1, 2, 0.3), 0px 1px 1px rgba(0, 1, 2, 0.3);
  --box-shadow-card-light: 0px 4px 4px rgba(229, 220, 189, 0.1),
    0px 2px 2px rgba(229, 220, 189, 0.1), 0px 1px 1px rgba(229, 220, 189, 0.1);
  --box-shadow-elevated-light: rgba(124, 114, 76, 0.4) 0px 5px 15px 0px;
  --box-shadow: light-dark(
    var(--box-shadow-card-light),
    var(--box-shadow-card-dark)
  );
  --box-shadow-elevated: light-dark(
    var(--box-shadow-elevated-light),
    var(--box-shadow-card-dark)
  );

  /* Layout */
  --navbar-height: 60px;
  --footer-height: 60px;
  --content-width: 700px;
  --layout-padding-vertical: 1.5rem;
  --layout-padding-horizontal: 1.5rem;
  --sidebar-width: 260px;
  --post-sidebar-width: 260px;
  --main-layout-width: calc(var(--post-sidebar-width) + var(--content-width));
  --font-size: 1rem;
  --anchor-padding: 0.25rem;
  --h1: 2.2rem;
  --h2: 1.8rem;
  --h3: 1.6rem;
  --h4: 1.2rem;

  font-family: var(--font-family);
  line-height: 1.6;
  font-weight: 400;
  font-size: 16px;

  color-scheme: light dark;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  color: var(--color-text);
  background-color: var(--color-background);
}

@media screen and (min-width: 600px) {
  :root {
    --layout-padding-vertical: 2rem;
    --layout-padding-horizontal: 2rem;
    --font-size: 1rem;
    --anchor-padding: 0.5rem;
    --h1: 2.6rem;
    --h2: 2rem;
    --h3: 1.8rem;
    --h4: 1.5rem;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

a {
  font-weight: 500;
  color: var(--color-text-link);
  text-decoration: inherit;

  &:hover {
    color: var(--color-text-link-hover);
  }

  &.anchor,
  &.anchor:hover {
    color: var(--color-text-link);
    background: transparent !important;

    svg {
      fill: var(--color-text-link);
    }

    &.before {
      padding-right: var(--anchor-padding);
    }
  }
}

body {
  margin: 0;
}

/* Headings */

h1,
h2,
h3,
h4,
h5 {
  color: var(--color-text-emphasized);
  scroll-margin-top: calc(var(--navbar-height) + 2.5rem);
  line-height: 1.3;
  font-family: var(--font-family-heading);
}

@media screen and (min-width: 1020px) {
  h1,
  h2,
  h3,
  h4,
  h5 {
    scroll-margin-top: 2rem;
  }
}

h1 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-weight: 700;
  font-size: var(--h1);
  line-height: 1.2;
}

h2,
h3,
h4,
h5,
p,
ul,
ol,
table,
blockquote {
  margin: 1.25rem 0;
}

h1:not(:first-child),
h2:not(:first-child),
h3:not(:first-child),
h4:not(:first-child) {
  margin-top: 3rem;
}

h2 + h3,
h3 + h4 {
  margin-top: 0 !important;
}

h2,
h3,
h4 {
  font-weight: 600;
}

h2 {
  font-size: var(--h2);

  code {
    font-size: var(--h2) !important;
  }
}

h3 {
  font-size: var(--h3);

  code {
    font-size: var(--h3) !important;
  }
}

h4 {
  font-size: var(--h4);

  code {
    font-size: var(--h4) !important;
  }
}

h5,
h5 code {
  font-size: 1rem;
  text-transform: uppercase;
}

p,
ol,
ul,
blockquote,
table {
  -webkit-font-smoothing: auto;
}

ul {
  padding-left: 1rem;
}

li {
  line-height: 1.6;
  padding-bottom: 0.25rem;

  p {
    margin-top: 0;
  }
}

ul li ul,
ol li ol {
  margin-top: 0;
  margin-bottom: 0;
}

ul li ul li {
  padding: 0;
}

li::marker {
  font-size: 1.1rem;
  line-height: 1;
  color: var(--color-marker);
}

mark {
  background: var(--yellow);
  border-radius: var(--border-radius);
}

table {
  border-collapse: collapse;
  border: 1px solid var(--color-border);
}

td,
th {
  border: 1px solid var(--color-border);
  padding: 0.25rem 0.75rem;
}

th {
  background: var(--color-background-alternate);
  border-bottom: 2px solid var(--color-border);
}

table tr:nth-child(even) {
  background: var(--color-background-alternate);
}

/* Buttons */

button,
a.button,
.button {
  display: inline-flex;
  align-items: center;
  background: var(--color-background-button);
  border: 2px solid var(--color-border-button);
  padding: 10px 14px;
  line-height: 1;
  border-radius: var(--border-radius);
  font-size: 1rem;
  cursor: pointer;
  font-weight: 500 !important;
  color: var(--color-text-button);
  gap: 0.25rem;
  white-space: nowrap;
  text-decoration: none !important;
  transition: 0.1s all ease;

  &:hover {
    background: var(--color-background-button-hover);
    border-color: var(--color-border-button-hover);
    color: var(--color-text-button-hover);
  }

  &.active,
  &:hover.active {
    color: var(--color-text-button-hover);
    background: var(--color-background-navbar-link-hover);
  }

  &:active {
    transform: scale(0.95);
  }

  &.icon {
    padding: 0.25rem;
  }

  &.small {
    font-size: 14px;
    padding: 0.5rem 0.75rem;
  }

  &.x-small {
    font-size: 11px;
    padding: 0.25rem 0.5rem;
  }

  img,
  img {
    min-height: 20px;
    min-width: 20px;
    max-height: 20px;
    margin-right: 0.25rem;
  }

  &.transparent-button {
    box-shadow: none;
    background: var(--color-background-input);
    border-color: var(--color-border);
    color: var(--color-text-emphasized);
    font-weight: 600;
    transform: none;

    &:hover {
      background: var(--color-background-input-hover);
    }
  }
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;

  a.button.small {
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
    gap: 0.5rem;
  }

  &.active {
    color: var(--color-text-link);
    background: var(--color-background-navbar);
  }
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
  width: 100%;
  height: var(--navbar-height);

  /* mobile */
  background: var(--color-background-navbar);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 0.7rem 0 var(--layout-padding-horizontal);
}

.navbar-title {
  display: flex;
  align-items: center;
  height: var(--navbar-height);
  z-index: 3;
}

.navbar-collapse {
  display: none;
}

a.navbar-title-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--color-text-navbar-link);
  white-space: nowrap;
  font-weight: 600;
}

.navbar-logo {
  height: 22px;
  width: 22px;
  min-height: 22px;
  min-width: 22px;
}

.navbar-container {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: var(--navbar-height);
  width: 100%;
}

.navbar-section {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.navbar-section-search {
  display: none;
}

.navbar-menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;

  a {
    white-space: nowrap;
    padding: 0.75rem 1rem;
    color: var(--color-text-navbar-link);
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 500;

    &:hover {
      background: var(--color-background-navbar-link-hover);
    }

    &.active {
      background: var(--color-background-navbar-link-active);
      color: var(--color-text-navbar-link-hover);
    }
  }

  &.social {
    gap: 2px;
  }

  &.nav-items {
    display: none;
  }

  img {
    height: 16px;
    width: 16px;
  }
}

button.navbar-button {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  background: transparent;
  padding: 0.5rem;
  height: 38px;
  width: 38px;
  color: var(--color-text-navbar-link);
  box-shadow: none;

  img {
    margin: 0;
  }

  &:hover {
    border: 1px solid transparent;
    background: var(--color-background-navbar-link-hover);
    color: var(--color-text-navbar-link-hover);
  }

  &.active,
  &:hover.active {
    border: 1px solid var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary);
    background: var(--color-background-navbar-link-hover);
    color: var(--color-primary);
  }
}

@media screen and (max-width: 799px) {
  .navbar-menu {
    &.nav-items {
      height: calc(100vh - var(--navbar-height));
      justify-content: center;
      padding-bottom: 40vh;

      a {
        font-size: 1.2rem;
        display: flex;
        gap: 0.5rem;
        align-items: center;
      }

      &.active {
        display: flex;
        flex-direction: column;
        width: 100%;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 2;
        margin-top: var(--navbar-height);
        background: var(--color-background-navbar);
        box-shadow: 0px 10px 15px rgba(0, 0, 0, 0.2);
      }
    }
  }
}

@media screen and (min-width: 1020px) {
  .navbar {
    display: none;
  }
}

@media screen and (min-width: 800px) {
  button.nav-menu-button {
    display: none;
  }

  .navbar-section {
    gap: 1rem;
  }

  .navbar-menu {
    &.nav-items {
      display: flex !important;
    }

    a {
      display: flex;
      gap: 0.5rem;
      align-items: center;
      padding: 0.5rem 0.75rem;
    }
  }
}

a.navbar-icon {
  height: 38px !important;
  width: 38px !important;
  background: transparent;
}

.sidebar {
  display: none;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
  background: var(--color-background-sidebar);
  border-right: 1px solid var(--color-border);
  min-width: var(--sidebar-width);
  width: var(--sidebar-width);
}

.sidebar-title-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;

  .site-name {
    color: var(--color-text-emphasized);
    font-size: 18px;
    font-weight: 600;
  }
}

.sidebar-section {
  margin: 1.25rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);

  &:last-child {
    padding-bottom: 3rem;
    border: none;
  }

  .sidebar-links,
  .sidebar-nav-links {
    display: flex;
    flex-direction: column;
    gap: 6px;

    a {
      color: var(--color-text-muted);
      display: flex;
      gap: 0.5rem;
      align-items: center;
      font-size: 14px;

      &:hover,
      &.active {
        color: var(--color-text-emphasized);
      }

      img {
        height: 16px;
        width: 16px;
      }
    }
  }

  .sidebar-nav-links {
    gap: 2px;

    a {
      border-radius: var(--border-radius);
      font-size: 16px;
      font-weight: 500;
      color: var(--color-text);
      padding: 4px 0.5rem;
      margin-left: -0.5rem;
      margin-right: -0.5rem;

      &:hover,
      &.active {
        text-decoration: none;
        color: var(--color-text-emphasized);
        background: var(--color-background-navbar-link-hover);
      }

      img {
        height: 20px;
        width: 20px;
      }
    }
  }

  p,
  h2 {
    margin: 1rem 0;
  }

  h2 {
    font-family: var(--font-family);
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
  }

  p {
    font-size: 14px;
  }

  > p:last-child {
    margin-bottom: 0;
  }
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  margin-left: -12px;
  line-height: 1;

  a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    padding: 8px 0.75rem;
    border-radius: var(--border-radius);
    font-size: 14px;
    color: var(--color-text-muted);
    font-weight: 500;

    &:hover {
      text-decoration: none;
      color: var(--color-text-emphasized);
      background: var(--color-background-navbar);
    }

    &.active {
      background: var(--color-background-navbar);
      color: var(--color-text-link);
    }

    img {
      height: 16px;
      width: 16px;
    }
  }
}

.sidebar-content {
  a:hover {
    text-decoration-line: underline;
    text-decoration-thickness: 2px;
  }

  p {
    font-size: 15px;
  }

  > p:last-child {
    margin-bottom: 0;
  }
}

.avatar {
  border-radius: var(--border-radius);
  height: 50px;
  width: 50px;
}

/* Sidebar */

@media screen and (min-width: 1020px) {
  .sidebar {
    display: block;
  }
}

/* Main */

.layout {
  margin-top: var(--navbar-height);
}

@media screen and (min-width: 1020px) {
  .layout {
    margin-top: 0;
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    max-width: calc(
      var(--content-width) + var(--sidebar-width) + var(--post-sidebar-width) +
        6rem
    );
    margin: 0 auto;
  }
}

.main-wrapper {
  min-height: 100vh;
}

.main-contanier {
  display: block;
  max-width: var(--main-layout-width);
}

.main-content {
  flex-grow: 1;
  max-width: var(--content-width);
  padding: var(--layout-padding-vertical) var(--layout-padding-horizontal);
  margin-right: auto;
  margin-left: auto;

  &.page {
    max-width: calc(var(--content-width) + var(--post-sidebar-width));
  }
}

@media screen and (min-width: 1020px) {
  .main-container {
    padding-left: var(--layout-padding-horizontal);
  }

  .main-content {
    margin-left: 0;
  }
}

@media screen and (min-width: 1360px) {
  .main-container {
    display: flex;
    gap: var(--layout-padding-horizontal);
    padding: 0 var(--layout-padding-horizontal);
    margin: 0 auto;
  }

  .main-content {
    margin: 0;

    &.page {
      margin-left: 1.5rem;
    }
  }
}

.post-sidebar {
  display: none;
  /* border-left: 1px solid var(--color-border); */
  width: var(--post-sidebar-width);
  min-width: var(--post-sidebar-width);
}

.post-sidebar-thumbnail {
  margin: 0 1.5rem;
  margin-bottom: 1rem;
}

.post-sidebar-section {
  padding-left: 1rem;
  border-bottom: 1px solid var(--color-border);

  p {
    margin-top: 0;
    margin-bottom: 0;

    &:last-of-type {
      margin: 0;
    }
  }

  &:last-of-type {
    margin-bottom: 0;
    border-bottom: none;
  }
}

.divider {
  width: 2px;
  height: 12px;
  background: var(--color-border);
}

.post-sidebar-content {
  position: sticky;
  top: 0;
  padding-top: var(--layout-padding-vertical);
  width: var(--post-sidebar-width);

  h2 {
    font-family: var(--font-family);
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1rem;
  }

  p {
    font-size: 14px;
  }

  nav {
    a {
      display: block;
      text-overflow: ellipsis;
      white-space: nowrap;
      overflow: hidden;
      padding: 6px 0.75rem;
      border-radius: var(--border-radius);
      font-size: 14px;
      color: var(--color-text-muted);
      font-weight: 500;

      &:hover {
        text-decoration: none;
        color: var(--color-text-emphasized);
        background: var(--color-background-navbar-link-hover);
      }

      &.active {
        color: var(--color-text-link);
        background: var(--color-background-navbar-link-active);
      }
    }

    ul,
    li,
    p {
      line-height: 1;
      padding: 0;
    }

    ul {
      margin: 0;
      padding-inline-start: 0;

      ul li > a {
        margin-left: 2rem;
        border-left: 1px solid var(--color-border);
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;

        &.active {
          border-color: var(--color-primary);
        }
      }
    }

    li {
      list-style-type: none;

      p {
        margin: 0;
      }
    }
  }
}

.post-sidebar-card {
  overflow-y: auto;
  max-height: calc(100vh - var(--navbar-height));
  scroll-padding-top: 60px;
  scroll-padding-bottom: 60px;
  scrollbar-width: none;
}

@media screen and (min-width: 1360px) {
  .post-sidebar {
    display: block;
  }
}

/* Hero */

.hero {
  margin-bottom: 1.5rem;

  .sub-title {
    display: flex;
    gap: 0.5rem;
    color: var(--color-text-muted);
    font-weight: 500;
    font-size: 1.1rem;
  }

  &.hero-post {
    h1 {
      border: none;
      padding: 0;
      line-height: 1.1;

      &.has-date {
        margin-top: 0.5rem;
      }
    }

    .post-date {
      color: var(--color-text-muted);
    }
  }

  &.hero-index {
    margin-bottom: 2.5rem;
  }

  &.hero-taxonomy {
    h1 {
      margin-top: 0;
    }
  }
}

@media screen and (min-width: 800px) {
  .hero {
    margin-bottom: 3rem;

    &.hero-index {
      margin-bottom: 4rem;
    }

    &.hero-page,
    &.hero-taxonomy {
      h1 {
        font-size: 3rem;
        font-weight: 800;
      }
    }

    &.hero-index {
      h1 {
        font-size: 3rem;
        font-weight: 800;
      }
    }
  }
}

.heading {
  gap: 0.5rem;
  margin-bottom: 2rem;

  h2 {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 0;
    margin-bottom: 0;
    margin-bottom: 0.5rem;

    .small {
      margin-top: 0.25rem;
    }
  }

  .description {
    color: var(--color-text-muted);
    font-size: 1.1rem;
  }
}

.section-index {
  padding-bottom: 2rem;
  margin-bottom: 1rem;
}

.hero-description {
  margin: 0 0 1.25rem 0;
  font-size: 1.1rem;
  max-width: 600px;
}

.hero-image {
  width: 100px;
  max-width: 100px;
}

.hero-container {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.hero-wrapper {
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-start;
  gap: 0.5rem;
}

@media screen and (min-width: 800px) {
  .hero-image {
    width: 150px;
    max-width: 150px;
  }

  .heading {
    span {
      border: none;
    }
  }

  .hero-description {
    font-size: 1.2rem;
  }

  .hero-image-container {
    position: relative;
    margin-top: 4rem;

    &::before {
      position: absolute;
      top: 1rem;
      left: 0;
      content: '';
      background: var(--color-primary);
      border-radius: 50%;
      height: 200px;
      width: 200px;
    }
  }

  .hero-image {
    display: block;
    position: relative;
    z-index: 9;
    width: 250px;
    max-width: 250px;
  }

  .hero-wrapper {
    flex-direction: row;
    gap: 3rem;

    a:hover {
      text-decoration: underline;
      text-decoration-thickness: 2px;
    }
  }
}

/* Posts */
a.post {
  display: flex;
  flex-direction: column;
  padding: 6px 0;
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);

  &:last-child {
    border-bottom: none;
  }

  > div {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    margin: 0;
  }

  time {
    display: block;
    width: 125px;
    min-width: 125px;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    font-weight: 400;
    text-decoration: none;
  }
}

@media screen and (min-width: 1020px) {
  a.post {
    flex-direction: row-reverse;
    justify-content: space-between;
    padding: 4px 0;

    time {
      display: flex;
      align-items: center;
      justify-content: flex-start;
      gap: 0.5rem;
    }

    &:hover {
      background: var(--color-background-navbar-link-hover);

      time {
        text-decoration: none;
        color: var(--color-text-emphasized);
      }
    }
  }
}

a time.new-post {
  color: var(--color-highlighted) !important;
}

.year {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;

  h2 {
    font-weight: 700;
    margin-bottom: 0.5rem;
  }

  &:last-of-type {
    border-bottom: none;
  }
}

@media screen and (min-width: 800px) {
  .year {
    h2 {
      padding-bottom: 0.5rem;
      border: 0;
    }
  }
}

/* Article */

.main-article,
.page-article {
  a {
    text-decoration: underline;

    &:hover {
      background: var(--color-background-navbar-link-active);
    }
  }

  h2 {
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
  }
}

.main-article-thumbnail {
  margin-bottom: 1rem;
}

@media screen and (min-width: 800px) {
  .main-article-thumbnail {
    float: left;
    margin-right: 1.5rem;
    margin-top: 36px;
  }
}

/* Cards */

.cards {
  display: grid;
  gap: 0.5rem;
}

@media screen and (min-width: 800px) {
  .cards {
    gap: 1rem;
    grid-template-columns: repeat(2, 1fr);
  }

  .cards.with-tags {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media screen and (min-width: 1360px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }

  .cards.with-tags {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Card */

.card {
  position: relative;
  padding: 0.75rem;
  background: var(--color-background-card);
  border-radius: var(--border-radius);
  border: 2px solid var(--color-border-card);
  box-shadow: var(--box-shadow);

  .card-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  a {
    font-weight: 600;

    &:hover {
      text-decoration: underline;
      text-decoration-thickness: 2px;
    }
  }

  &.card-highlight {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none !important;
    line-height: 1.3;

    div {
      font-weight: 600;
      color: var(--color-text-emphasized);
    }

    &:hover {
      border-color: var(--color-primary);

      div {
        color: var(--color-text-link-hover);
      }
    }

    .gatsby-image-wrapper {
      min-width: 40px;
      min-height: 40px;
    }
  }

  time {
    display: block;
    font-size: 14px;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
  }

  p {
    font-size: 0.9rem;
    color: var(--color-text);
    line-height: 1.5;
    margin: 0.5rem 0 1rem;
  }
}

@media screen and (min-width: 1020px) {
  .card {
    padding: 1rem;

    a {
      font-size: 1.1rem;
    }
  }
}

.stars {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.star {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--yellow);

  a {
    font-size: 0.9rem;
    color: var(--color-text-emphasized);
  }
}

.image-thumbnail {
  margin-top: 1rem;
  height: 250px;
  border-radius: var(--border-radius);
  width: 100%;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
}

/* Blockquote */

blockquote {
  padding: 1rem;
  margin: 1.25rem 0;
  border-left: 4px solid var(--color-border-blockquote);
  background: var(--color-background-blockquote);
  color: var(--color-text-emphasized);
  border-top-right-radius: var(--border-radius);
  border-bottom-right-radius: var(--border-radius);
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 400;

  > * {
    margin-top: 0;
  }

  *:last-child {
    margin-bottom: 0;
  }

  ul {
    margin-top: 1.5rem;
  }

  strong {
    text-decoration-line: underline;
    text-decoration-thickness: 1px;
    font-weight: 700;
  }

  &.quotation {
    font-family: Georgia, 'Times New Roman', Times, serif;
    font-size: 1.1rem;
    border: none;
    border-radius: 0;
    border-left: 8px solid var(--color-border);
    background: transparent;
    padding: 0 1rem;
    font-weight: 500;

    cite {
      display: block;
      margin-top: 1.5rem;
      font-size: 1rem;
      font-family: var(--font-family);
    }
  }
}

@media screen and (min-width: 800px) {
  blockquote {
    padding: 1rem 1.5rem;

    &.quotation {
      padding: 0 1.5rem;

      p {
        font-size: 1.2rem;
      }
    }
  }
}

/* Image */

img {
  display: block;
  max-width: 100%;
}

img.image-float {
  margin: 1.25rem 0;
  height: auto;
}

@media screen and (min-width: 800px) {
  img.image-float {
    float: right;
    max-width: 300px;
    margin: 0 0 1.5rem 1.5rem;
    max-width: 300px;
    height: auto;
  }
}

/* Commets */

.comments {
  margin-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  scroll-margin-top: 2.5rem;
}

/* Footer */

.footer {
  border-top: 1px solid var(--color-border);
  padding: 1.25rem 0;
  font-size: 13px;
}

a.footer-link {
  white-space: nowrap;
  color: var(--color-text-muted);

  &:hover {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    color: var(--color-text-link-hover);
  }
}

.floppy-logo {
  display: inline-block;
  height: 18px;
  width: 18px;
}

.footer-made-by {
  display: flex;
  align-items: center;
  gap: 5px;
}

.footer-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  gap: 1.5rem;
  max-width: var(--content-width);
  margin-left: auto;
  margin-right: auto;
}

.footer-menu {
  display: flex;
  gap: 0.75rem;
}

.footer-menu-buttons {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
}

@media screen and (min-width: 800px) {
  .footer {
    font-size: 14px;
  }

  .footer-menu {
    display: flex;
  }
}

@media screen and (min-width: 1360px) {
  .footer-section {
    max-width: calc(var(--main-layout-width) + 2rem);
  }
}

.flex {
  display: flex;
}

.flex-space-between {
  display: flex;
  justify-content: space-between;
}

.flex-align-center {
  display: flex;
  align-items: center;
}

.flex-wrap {
  flex-wrap: wrap;
}

.small-gap {
  gap: 0.5rem;
}

.gap {
  gap: 0.75rem;
}

.main-article {
  .gatsby-remark-prismjs-copy-button-container {
    position: relative;

    .gatsby-remark-prismjs-copy-button {
      position: absolute;
      top: 0;
      right: 1rem;
      border-radius: var(--border-radius);
      border: 1px solid var(--color-border);
      background: var(--color-background-navbar);
      color: var(--color-text-muted);
      line-height: 1;
      padding: 4px 6px;
      z-index: 99;

      &:hover {
        background: var(--color-background-navbar);
        border: 1px solid var(--color-border-hover);
        color: var(--color-text);
      }
    }
  }
}

.highlight {
  font-weight: 700;
  color: var(--color-text-emphasized);
}

.searched {
  font-weight: 600;
  color: #111;
  background: var(--yellow);
}

.search-container {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;

  &.with-button {
    gap: 0;

    input,
    button {
      height: 36px;
    }

    input {
      border-top-right-radius: 0;
      border-bottom-right-radius: 0;
    }

    button {
      border-top-left-radius: 0;
      border-bottom-left-radius: 0;
      border-left: 0;
    }
  }
}

.search-icon {
  position: absolute;
  left: 0.5rem;
  top: 8px;
  height: 24px;
  width: 24px;
}

.searchbar {
  border-radius: var(--border-radius);
  background: var(--color-background-input);
  border: 2px solid var(--color-border);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  box-shadow: none;
  max-width: 260px;

  &:hover {
    border-color: var(--color-border-hover);
    background: var(--color-background-input-hover);
  }

  &:focus {
    outline: none;
    border: 2px solid var(--color-primary);
    background: var(--color-background-input-hover);
  }

  &.with-icon {
    padding: 0.5rem 1rem 0.5rem 2.5rem;
  }
}

.small {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.site-name {
  &:hover {
    text-decoration: underline;
    text-decoration-thickness: 2px;
  }
}

.hidden {
  display: none;
}

.chip {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  border-radius: var(--border-radius);
  color: var(--color-text-muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

@media screen and (min-width: 1360px) {
  .article-type-wrapper {
    display: flex;
    align-items: flex-start;

    .section-index {
      flex: 1;

      &:nth-of-type(2n) {
        margin-left: 1.5rem;
        padding-left: 1.5rem;
        border-left: 1px solid var(--color-border);
      }
    }
  }
}

.circles {
  display: flex;
  flex-direction: column;
}

.circle {
  height: 16px;
  width: 16px;
  border-radius: 50%;
}

.dropdown {
  position: relative;

  .dropdown-results {
    position: absolute;
    top: 44px;
    left: 50%;
    transform: translate(-50%, 0);
    background: var(--color-background-sidebar);
    border: 1px solid var(--color-border);
    padding: 0.5rem 0;
    border-radius: var(--border-radius);
    z-index: 99;
    box-shadow: var(--box-shadow);
  }

  .dropdown-option {
    padding: 0.5rem 1rem;
    cursor: pointer;

    &:hover {
      background: var(--color-background-navbar-link-hover);
    }
  }
}

.introduction {
  scroll-margin-top: 40px;
}

.strike {
  text-decoration: line-through;
}

.tooltip-container {
  position: relative;

  .tooltip {
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    display: block;
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-elevated);
    background: var(--color-background-alternate);
    padding: 6px 12px;
    color: var(--color-text-emphasized);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid var(--color-border);
  }

  &:hover {
    .tooltip {
      z-index: 2;
      opacity: 1;
    }
  }
}
